<?php

if (!init()) {
    redirect('?action=login');
}

echo "A";
$dialogId = checkDialogCreated($_GET['uid']);
echo "A";
if ($dialogId) {
    redirect("?action=conv&did=" . $dialogId);
} else {
    $newdialogId = createDialog($_GET['uid']);
    redirect("?action=conv&did=" . $newdialogId);
}